home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 26.zip
/
BS1 part 26
/
Dopus Opus II 2.05E.adf
/
t
/
TxEd.Backup
< prev
Wrap
Text File
|
2004-10-06
|
19KB
|
536 lines
/**************************************************************************/
/* */
/* This Arexx script is a simple demo script to show some of the features */
/* offered by the ARexx port in Directory Opus II. */
/* */
/* Michael Portmann */
/* V1.0 27th November 1990 */
/* */
/* Cleaned up a bit by Jonathan Potter, April 25th 1991 */
/* */
/* Thanks to DIABOLIKA GROUP and NEMESIS for this arexx-demo !!! */
/* */
/* To run this script you can either: */
/* */
/* 1) Use rx to run the script from the cli */
/* 2) Create a custom gadget for this script */
/* 3) Click on the ARexx gadget and type in the path and name of this */
/* script, for example rexx:DOpus/Demo.DOpus */
/* or 4) Call this ARexx script from another program which will allow */
/* you to run ARexx scripts */
/* */
/* Please check your DOpus manual or the other programs manual if you */
/* do not understand how to do the above. */
/* */
/**************************************************************************/
address 'dopus_rexx'
options results
signal on error /* On signal ERROR, exit script */
signal on syntax /* On signal SYNTAX, exit script */
signal on ioerr /* On signal IOERR, exit script */
clear_top = 'A0'X
/******************************************************/
/* */
/* Start main part of demo */
/* */
/******************************************************/
dopustofront
toptext clear_top
/************************************************************
************************************************************/
address 'dopus_rexx'
options results
signal on error /* On signal ERROR, exit script */
signal on syntax /* On signal SYNTAX, exit script */
signal on ioerr /* On signal IOERR, exit script */
clear_top = 'A0'X
dopustofront
toptext clear_top
/***********************************************************
************************************************************/
status 71 /* Is Directory Opus currently iconified ? */
icon = result
if icon = 1 then uniconify /* Uniconify if already iconified */
'status 47 0 set BBS:3/Upload' /* Read DF0: into the left hand window */
'status 47 1 set RAM:' /* Read RAM: into the right hand window */
if icon = 1 then iconify /* If iconified before, return to that state */
/**********************************************************
***********************************************************/
call demo_intro
call flash 3,'*** Back to front - part 1 ***'
call back_front
call display '*** End back to front part ***',4,4
call flash 3,'*** Requesters - part 2 ***'
call requester_demo
call display '*** End requester part ***',4,4
call flash 3,'*** Busy pointer - part 3 ***'
call busy_demo
call display '*** End busy pointer part ***',4,4
call flash 3,'*** File adding/removing - part 4 ***'
call file_demo
call display '*** End file adding/removing part ***',4,4
call flash 3,'*** Configuration settings - part 5 (the last) ***'
call config_demo
call display '*** End configuration settings ***',4,4
call display '*** End of Directory Opus arexx-demo ! ***',4,2
call display 'Thankyou, enjoy your script writing!',4,2
return
/******************************************************/
/* */
/* Display start of intro to demo */
/* */
/* (Pretty simple, uses the flash and wait functions */
/* at the end of this script) */
/* */
/******************************************************/
demo_intro:
call flash 5,'*** NEMESIS BBS ***'
call wait(2)
call display 'Sysop URAN CoSysop REJ',2,1
call display 'presents:',2,3
call display 'Directory Opus II 2.05e 100%',5,0
call display 'Please wait until arexx-demo has finished',3,4
return
/******************************************************/
/* */
/* Change requester gadgets */
/* */
/* This function shows how to request a boolean */
/* result through DOpus and how to change the gadget */
/* text to customize the requester. */
/* */
/******************************************************/
requester_demo:
status 69 set 'URAN'
status 70 set 'REJ'
call display 'I can use a boolean requester for input',4,1
request 'Click on' URAN 'or' REJ
call chkres 'You clicked on',URAN,REJ,'!',4,1
call display 'I can change the 'URAN 'and' REJ,
'requester gadgets',5,1
status 69 set 'Call' /* Modify gadgets */
status 70 set 'Now'
request 'Now Click on Call or Now'
call chkres 'You clicked on','Call','Now','!',4,4
status 69 set Okay /* Restere old settings */
status 70 set Cancel
call display 'If need be, I can get a whole string of text',4,1
getstring 'Enter N E M E S I S'
call scroll 2,result,2
call wait(2)
return
/******************************************************/
/* */
/* DOpus window to back - front demo */
/* */
/* This function is extreamly simple, just read it. */
/* if you don't understand it, forget about */
/* learning ARexx ! */
/* */
/******************************************************/
back_front:
call display 'I can move the DOpus screen to the back',4,1
dopustoback /* Push DOpus window to the back */
call wait(3)
dopustofront /* Bring DOpus window back to the front */
call wait(1)
call display 'and afterwards, I can bring it back to the front',4,3
return
/******************************************************/
/* */
/* Function shows the use of the busy pointer */
/* */
/* This function is very simple, nothing out of the */
/* ordinary. */
/* */
/******************************************************/
busy_demo:
dopustofront
busy on
call wait (2)
call display 'Call now to make up for lost time',4,1
call display 'NEMESIS BBS (DIABOLIKA GROUP) 200 megs on-line!',6,0
call display '++39 (0)51 355-315 OR ++39 (0)51 359-718',9,0
busy off
call wait(2)
toptext clear_top
call wait(2)
return
/******************************************************/
/* */
/* Function clears all files and adds new ones */
/* */
/* This function is a demonstration of how to work */
/* with adding and removing files in DOpus. The best */
/* way to describe it is simply to read it through. */
/* (As most of us have to do !) */
/* */
/******************************************************/
file_demo:
call display 'I can remove all the files in a given window',4,1
status 37
if result = 1 then swapwindows /* Switch selected window to 0 */
status 55
old_buff = result /* Get current buffer */
next_buff = old_buff + 1 /* Get next buffer */
if next_buff = 20 then next_buff = 0
/* Highly unlikely, but it's all possible! */
status 55 set next_buff /* Move to next buffer */
call clear_entries(0)
call display 'Note that I moved on to the next window buffer',6,1
call display 'this means that the original window is still intact.',6,2
call display 'I can switch back to it after I have finished with the next',
'window buffer.',6,1
status 55 set old_buff
call wait(1)
call display 'See !',4,1
status 55 set next_buff
toptext clear_top
call wait(3)
call display 'Anyway, now to add some files to this window',4,1
do i = 1 to 5
addfile '"NEMESIS BBS ++39 (0)51 355-315"'i 1000*i '-1' '100' '"No Comment"' 'rwed' 0 1
end
call wait(2)
call display 'NOTE: the files were created inside a do end loop',
'for i = 1 to 5 with :',6,1
call display 'addfile ''"NEMESIS File"''i '1000*i' ''-1'' ''100''',
'''"No Comment"'' ''rwed'' 0 1',10,1
call display 'DOpus uses the quotes to allow spaces to be included',
'in names or comments',5,3
call display 'In the same way, directories can be added :',4,1
do i = 1 to 5
addfile '"For New Stuff Call... "'i 1000*i '1' '100' '"No comment"' 'rwed' 0 1
end
call wait(2)
call display 'Now, I can remove entries (both directories and files)',
'from the window',5,1
removefile '"NEMESIS BBS ++39 (0)51 355-315 2"' 1
call wait(1)
removefile '"NEMESIS BBS ++39 (0)51 355-315 4"' 1
call wait(1)
removefile '"For New Stuff Call... 2"' 1
call wait(1)
removefile '"For New Stuff Call... 4"' 1
call wait(3)
call display 'NOTE : Although you can add and remove entries through ARexx',
'and DOpus,',6,0
call display 'it really only makes sense to do so when appropriate.',5,1
status 55 set old_buff
return
/******************************************************/
/* */
/* Function shows configuration */
/* */
/* This function goes through finding out all the */
/* options set by the user and telling them. */
/* */
/******************************************************/
config_demo:
call display 'I can now tell you some of your DOpus configurations',4,1
status 1
call chkres 'You','have','do not have','workbench to front on',4,1
status 2
call chkres 'Interlace','is','is not','on',4,1
status 3
call chkres 'File double click','is','is not','on',4,1
status 4
call chkres 'You','wish','do not wish','files to be seperated from directories',4,1
status 5
call chkres 'You wish files with hidden bit set','to not','to','be displayed',4,1
status 6
call chkres 'You have dynamic update','on','off','',4,1
status 7
call chkres 'Error checking is','on','off','',4,1
status 8
call chkres 'You','wish','do not wish','to be asked before files are deleted',4,1
status 9
call chkres 'You','wish','do not wish','to be asked before directories are deleted',4,1
status 10
call chkres 'You','want','do not want','file info to be displayed',4,1
status 11
call chkres 'Existing files will be replaced','when requested','at all times','',4,1
status 12
call chkres 'Icons will','be','not be','created with created directories',4,1
status 13
call chkres 'Programs','will','will not','be run asynchronously',4,1
status 14
call chkres 'Smart parent/root option is turned','on','off','',4,1
status 15
call chkres 'All actions','will','will not','do unto icons',4,1
status 16
call display 'Current Help file is :' result,4,1
status 17
select
when result = 0 then free_text = 'bytes'
when result = 1 then free_text = 'KBytes/MBytes'
when result = 2 then free_text = 'blocks'
when result = 3 then free_text = 'percentage'
end
call display 'Current free disk space is shown as' free_text 'free',4,1
status 18
select
when result = 0 then clock_type = 'has a 24hr clock'
when result = 1 then clock_type = 'has a 12hr clock'
when result = 2 then clock_type = 'has no clock'
when result = 3 then clock_type = 'is hidden'
end
call display 'Currently the iconified window' clock_type,4,1
status 19
call chkres 'The screen clock is a','12hr','24hr','clock',4,1
/* More to go */
return
/******************************************************/
/* */
/* Function gives the answer ans1 or ans2 */
/* */
/* Given the status to check, the program will send */
/* the given string and then the matching answer for */
/* a status return value of yes or no. */
/* */
/******************************************************/
chkres:
parse arg text1,ans1,ans2,text2,wait1,wait2
select
when result = 1 then call display ''text1 ans1 text2'',wait1,wait2
when result = 0 then call display ''text1 ans2 text2'',wait1,wait2
end
return
/******************************************************/
/* */
/* Function scrolls text across the top text bar */
/* */
/* This function scrolls text across the top of the */
/* message bar on the DOpus screen. It is very messy */
/* but works, and thats all that was intended to do. */
/* */
/******************************************************/
scroll:
parse arg start_wait,text,end_wait
text = space(text,1,'A0'X)
text = copies('A0'X,80) || text || copies('A0'X,80)
call wait(start_wait)
if length(text) > 80
then
do char = 1 to length(text)
toptext substr(text,char,80,'A0'X)
end
call wait(end_wait)
return
/******************************************************/
/* */
/* Function clears all entries in given window */
/* */
/* This function clears all the entries (directories */
/* and files) in the given DOpus window. The function */
/* should work in all cases, one that didn't work */
/* when I first wrote it was a file with spaces but */
/* as DOpus will remove the quotes from quoted files */
/* I quoted before sending and it works fine now. */
/* */
/******************************************************/
clear_entries:
arg window
status 37 set window /* Set selected window to 0 */
status 40 window /* Get number of entries in 0 */
number = result
if number >= 0 then
do i = 1 to number
getentry 1
name = result
removefile '"'name'"' 1
end
return
/******************************************************/
/* */
/* Function flashes the given text x times */
/* */
/* This function simply flashes the text given with */
/* a two second pause between flashes. The function */
/* uses the wait() procedure below */
/* */
/******************************************************/
flash:
parse arg times,text
do i = 1 to times
toptext text
call wait(1)
toptext clear_top
call wait(1)
end
return
/******************************************************/
/* */
/* Function displays text and pauses */
/* */
/* This function will display text in the top message */
/* section on the DOpus screen. The program waits */
/* a given number of seconds using wait() below and */
/* then clears the text and waits another given time */
/* period. */
/* */
/******************************************************/
display:
parse arg text,wait_1,clear_wait
toptext text
if wait_1 > 0 then call wait(wait_1)
toptext clear_top
if wait_1 > 0 then call wait(clear_wait)
return
/******************************************************/
/* */
/* Function waits until a given time period passes */
/* */
/* This function simply waits until a given number */
/* of seconds pass. I tried looking for an easier way */
/* to accomplish the task without busy waiting, but */
/* alas, I couldn't find support anywhere. */
/* */
/******************************************************/
wait:
arg time_wait
time_until = time('S') + time_wait
do while time(s) < time_until
end
return
/******************************************************/
/* */
/* Error subroutine */
/* */
/* This function remains to show a simple form of */
/* error checking, you will get errors while writing */
/* a script and this (and the following) can make */
/* life easier ! */
/* */
/******************************************************/
error:
address 'DOpus_rexx'
toptext '*** ERROR('rc'): line('SIGL')' errortext(rc)
exit
/******************************************************/
/* */
/* Syntax Error subroutine */
/* */
/******************************************************/
syntax:
address 'DOpus_rexx'
toptext '*** SYNTAX ERROR('rc'): line('sigl')' errortext(rc)
exit
/******************************************************/
/* */
/* I/O Error subroutine */
/* */
/******************************************************/
ioerr:
address 'DOpus_rexx'
toptext '*** IOERR('rc'): line('sigl')' errortext(rc)
exit
/***************/
/* The end ! */
/***************/